home *** CD-ROM | disk | FTP | other *** search
/ 10,000 Great Games / 10,000 Great Games.iso / Product / 66 / data1.cab / Source_Files / Src / Inflame.cpp < prev    next >
C/C++ Source or Header  |  2000-01-16  |  750b  |  44 lines

  1. #include "stdafx.h"
  2.  
  3. cInflamable::cInflamable(int _x, int _y, cProperties *_orig)
  4.             : cWeapon(_x, _y, _orig, "MOVING")
  5.     orig->get_sequence("ON FIRE", on_fire_seq);
  6.     
  7.     move_object_after_hit = FALSE;
  8.  
  9.     ASSERT(!inflamable_contents_list.is_empty());
  10. }
  11.  
  12. cInflamable::~cInflamable()
  13. {
  14. }
  15.  
  16. int cInflamable::control()
  17.     cWeapon::control();
  18.     
  19.     bounce_on_boundaries();
  20.     
  21.     // Check if we fell onto something
  22.     
  23.     if (resting && explode)
  24.     {
  25.         cHurting *h = new cHurting(x, y, inflamable_contents_list.get_random());
  26.             
  27.         h->set_position(x, y);
  28.         h->make_dirty();
  29.             
  30.         return FALSE;        
  31.     }
  32.     
  33.     return !in_water();
  34. }
  35.  
  36. void cInflamable::hit(fix, cWeapon *)
  37. {
  38.     explode = TRUE;
  39.     
  40.     set_sequence(on_fire_seq, TRUE);
  41. }
  42.